<?php
namespace Model;
require_once __DIR__."/../Lib/mydb.php";
require_once __DIR__."/../Utils/Contains.php";
require_once __DIR__."/../Utils/RongUtils.php";
use Lib\mydb;
use Utils\RongUtils;
use Model;
use Utils\Contains;
class Sign{
    private static $db=null;
    private $id;
    private $x;
    private $y;
    private $address;
    private $date;
            function __construct($array) {
        $this->id=$array['id'];
        $this->x=$array['x'];
        $this->y=$array['y'];
        $this->address=$array["address"];
        $this->date=$array["date"];
        if(self::$db==null)
            self::$db =new mydb();
       
    }
    public function insert(){
         $sql="insert into sign(id,x,y,address,date) values('".$this->id."','".$this->x."','".$this->y."','".$this->address."','".$this->date."');";
        if(self::$db->exec($sql))
            return 1;
        else
            return 0;
    }
}